Extremely high win rate FOREX swing strategyTHis is a very simple yet extremely efficient FOREX strategy .
In general it tends to work the best against NZD and AUD pairs, however other major pairs and crosses can work as well.
It's made of a time management, together with MACD , moving average , a price action rule and a risk management.
THe logic behind is the next one :
For LONG:
We have 3 ascending candles.
Histogram of MACD is positive.
Last close of a candle is was above moving average.
If all those previous condition happened before 17/18 UTC time depending if its summer time or not, we enter the trade.
For Short:
We have 3 descending candles.
Histogram of MACD is negative.
Last close of a candle is was below moving average.
If all those previous condition happened before 17/18 UTC time depending if its summer time or not, we enter the trade.
RIsk management
For risk management, since we aim to have a 95%+ win rate, we aim to have a 5:1 or 10:1 risk to reward ratio. Meaning that for each $ we can win, we can lose 5-10$.
THats why I recommend to be extremely careful when playing with leverage with this strategy.
[b]forex
Full Forex scalper StrategyTHis is a FOREX scalping system that can be optimized with almost all majors and crosses pairs.
Its made of multiple elements such as :
MACD
Stochastic RSI
Fast VW moving average
Slow VW moving average
Time management( forex sessions as inputs)
Rules for entry
Long
Last 2 MACD values were ascending, fast moving average is below moving average and stochastic RSI is below 30 level. At the same time we are either into London or NY session.
Short
Last 2 MACD values were descending, fast moving average is above moving average and stochastic RSI is above 70 level. At the same time we are either into London or NY
Rules for exit
WE have 2 exit possibilities: we can exit either at the end of NY/London Session or based on a TP/SL risk management calculating % in movement.
If you have any questions let me know !
Forex bot full strategy with risk managementThis is a full strategy designed for forex major pairs, specially EUR/USD using 1h time frame chart.
Its components are
200 EMA
MACD
OBV
PSAR
RIsk management with tp and sl movements
Rules for entry
For long = Previous histogram from MACD was below 0 and current one is above 0. CLose of a candle is above EMA 200 , OBV oscillator is negative and we have an uptrend from PSAR
For short = Previous histogram from MACD was above 0 and current one is below 0. CLose of a candle is below EMA 200 , OBV oscillator is positive and we have an downtrend from PSAR
Rules for exit
For tp and sl values we calculate the distance from the close of candle until the psar values.
If you have any questions, let me know !
Forex Daytrade T3 MA sessionThis is a simple yet very efficient daytrading strategy for most crosses pairs, like EUR/NZD, EUR/AUD , GBP/NZD, GBP/AUD and so on.
It tends to works best with 1h and 15 min time frame charts.
Its components are :
Entry time = session that we want to trade, where we can combine for example half of London and all of NY using an hour system.
T3 Moving average
Price action.
Rules for entry
For long , we are during the hours we want to trade, current close is price is above previous high and at the same time is above moving average
For short , we are during the hours we want to trade, current close is price is below previous low and at the same time is below moving average
Rules for exit
We exit when either the opposite condition is triggered, if the hours of trading are off or based on a percentage TP/SL system movement.
For this example we use 1% movement both for TP and SL
If you have any questions, let me know !
Forex scalper 2xEMA + SRSI + MACDThis is a forex scalping strategy designed for the most liquid pairs, like major forex pairs.
Its made of
1 EMA 50
1 EMA 100
Stochastic RSI
MACD
Rules
For long :close of the candle is above moving average 50, moving average 50> moving average 100, macd histogram is positive and cross over of stochastic rsi with the oversold level.
For short :close of the candle is below moving average 50, moving average 50 < moving average 100, macd histogram is negative and cross under of stochastic rsi with the overbought level.
Exit
For exit we have take profit and stop loss using fixed pip points.
For this example on EURUSD we use 20 pips for both tp and sl
IF you have any questions let me know !
Swing forex strategy 15minThis is a strategy made using BB+ RSI indicators that seems to work great with 15 min major pairs for FOREX.
THe rules for it are simple:
For long we enter when the close of our candle crosses upwards the lower line and rsi crossover the over sold line
We exit long when we have a short entry.
For short we enter when the close of the candle crosses downwards the top line and rsi cross under the over bought line
WE exit short when we have a long entry.
Careful, this strategy has no risk management inside.
If you have any questions let me know !
Alert(), alertcondition() or strategy alerts?Variety of possibilities offered by PineScript, especially thanks to recent additions, created some confusion. Especially one question repeats quite often - which method to use to trigger alerts?
I'm posting this to clarify and give some syntax examples. I'll discuss these 3 methods in chronological order, meaning - in the order they were introduced to PineScript.
ALERTCONDITION() - it is a function call, which can be used only in study-type script. Since years ago, you could create 2 types of a script: strategy and study. First one enables creating a backtest of a strategy. Second was to develop scripts which didn't require backtesting and could trigger alerts. alertcondition() calls in strategy-type scripts were rejected by Pine compiler. On the other hand compiling study-type scripts rejected all strategy...() calls. That created difficulties, because once you had a nice and backtested strategy, you had to rip it off from all strategy...() function calls to convert your script to study-type so you could produce alerts. Maintenance of two versions of each script was necessary and it was painful.
"STRATEGY ALERTS" were introduced because of alertcondition() pains. To create strategy alert, you need to click "Add alert" button inside Strategy Tester (backtester) and only there. Alerts set-up this way are bound with the backtester - whenever backtester triggers an order, which is visible on the chart, alert is also fired. And you can customize alert message using some placeholders like {{strategy.order.contracts}} or {{ticker}}.
ALERT() was added last. This is an alerts-triggering function call, which can be run from strategy-type script. Finally it is doable! You can connect it to any event coded in PineScript and generate any alert message you want, thanks to concatenation of strings and wrapping variables into tostring() function.
Out of these three alertcondition() is obviously archaic and probably will be discontinued. There is a chance this makes strategy/study distinction not making sense anymore, so I wouldn't be surprised if "studies" are deprecated at some point.
But what are the differences between "Strategy alerts" and alert()? "Strategy alerts" seem easier to set-up with just a few clicks and probably easier to understand and verify, because they go in sync with the backtester and on-chart trade markers. It is especially important to understand how they work if you're building strategy based on pending orders (stop and limit) - events in your code might trigger placing pending order, but alert will be triggered only (and when) such order is executed.
But "Strategy Alerts" have some limitations - not every variable you'd like to include in alert message is available from PineScript. And maybe you don't need the alert fired when the trade hit a stop-loss or take-profit, because you have already forwarded info about closing conditions in entry alert to your broker/exchange.
Alert() was added to PineScript to fill all these gaps. Is allows concatenating any alert message you want, with any variable you want inside it and you can attach alert() function at any event in your PineScript code. For example - when placing orders, crossing variables, exiting trades, but not explicitly at pending orders execution.
The Verdict
"Strategy Alerts" might seem a better fit - easier to set-up and verify, flexible and they fire only when a trade really happens, not producing unnecessary mess when each pending order is placed. But these advantages are illusionary, because they don't give you the full-control which is needed when trading with real money. Especially when using pending orders. If an alert is fired when price actually hit a stop-order or limit-order level, and even if you are executing such alert within 1 second thanks to a tool like TradingConnector, you might already be late and you are making entry at a market price. Slippage will play a great role here. You need to send ordering alert when logical conditions are met - then it will be executed at the price you want. Even if you need to cancel all the pending orders which were not executed. Because of that I strongly recommend sticking to ALERT() when building your alerts system.
Below is an example strategy, showing syntax to manage placing the orders and cancelling them. Yes, this is another spin-off from my TradingView Alerts to MT4 MT5 . As usual, please don't pay attention to backtest results, as this is educational script only.
P.S. For the last time - farewell alertcondition(). You served us well.
Moving Stop-Loss mechanism + alerts to MT4/MT5"How to code moving stop-loss mechanism", is one of the most often repeating questions in private messages I receive, so just to focus on this mechanism, I made a spin-off from my previous script: TradingView-Alerts-to-MT4-MT5-dynamic-variables-NON-REPAINTING .
The logic here moves the stop-loss each time a trade is running and a new pivot high/low is detected. When such event occurs (UpdateLongStopLoss or UpdateShortStopLoss), stoploss_long or stoploss_short mutable variable is modified. And it needs to be coded inside strategy.exit() line as "stop=stoploss_long" or "stop=stoploss_short". Entries are pretty straightforward - on Stoch crosses.
Last lines of the script show how to wrap information about such updates and send send alerts to MetaTrader via TradingConnector for execution in Forex/indices/commodities/crypto markets via MetaTrader. Please note that "tradeid=" variable must be passed with each alert, to let MetaTrader know which trade to modify. SLMOD, TPMOD are recently added commands, along with BE (as in "move stop-loss to breakeven" - but that's another topic).
Please disregard strategy backtest results, as this script is for coding education purposes only. However, it seems with the stop-loss mechanism enabled, the results are even better, than in original version of the script :)
Scalp - 50/200 EMAWorks on any timeframe but was built originally for scalping. Uses 50EMA and 200EMA to define the trend and touch backs on to the 50 EMA for entry.
200 EMA - White Line
50 EMA - Yellow Line
ATR: Length 14 Smoothing RMA
1. Wait for 50ema to crossover 200 ema – Then wait for candle to touch 50 ema after the cross.
2. Entry: Green candle that closes above 50 ema without getting more than 3 candles closing below(BUY) or above (SELL) 50ema.
3. Stop loss: 2x ATR value below entry candle.
4. Take profit: 1.5x the risk.
Settings allow for # of Entries allowed per trend as well as EMA periods.
Opposite for Sell Entries (Stop Loss: 2x ATR value above entry candle)
How to use Leverage and Margin in PineScriptEn route to being absolutely the best and most complete trading platform out there, TradingView has just closed 2 gaps in their PineScript language.
It is now possible to create and backtest a strategy for trading with leverage.
Backtester now produces Margin Calls - so recognizes mid-trade drawdown and if it is too big for the broker to maintain your trade, some part of if will be instantly closed.
New additions were announced in official blogpost , but it lacked code examples, so I have decided to publish this script. Having said that - this is purely educational stuff.
█ LEVERAGE
Let's start with the Leverage. I will discuss this assuming we are always entering trades with some percentage of our equity balance (default_qty_type = strategy.percent_of_equity), not fixed order quantity.
If you want to trade with 1:1 leverage (so no leverage) and enter a trade with all money in your trading account, then first line of your strategy script must include this parameter:
default_qty_value = 100 // which stands for 100%
Now, if you want to trade with 30:1 leverage, you need to multipy the quantity by 30x, so you'd get 30 x 100 = 3000:
default_qty_value = 3000 // which stands for 3000%
And you can play around with this value as you wish, so if you want to enter each trade with 10% equity on 15:1 leverage you'd get default_qty_value = 150.
That's easy. Of course you can modify this quantity value not only in the script, but also afterwards in Script Settings popup, "Properties" tab.
█ MARGIN
Second newly released feature is Margin calculation together with Margin Calls. If the market goes against your trades and your trading account cannot maintain mid-trade drawdown - those trades will be closed in full or partly. Also, if your trading account cannot afford to open more trades (pyramiding those trades), Margin mechanism will prevent them from being entered.
I will not go into details about how Margin calculation works, it was all explainged in above mentioned blogpost and documentation .
All you need to do is to add two parameters to the opening line of your script:
margin_long = 1./30*50, margin_short = 1./30*50
Whereas "30" is a leverage scale as in 30:1, and "50" stands for 50% of Margin required by your broker. Personally the Required Margin number I've met most often is 50%, so I'm using value 50 here, but there are literally 1000+ brokers in this world and this is individual decision by each of them, so you'd better ask yourself.
--------------------
Please note, that if you ever encounter a strategy which triggers Margin Call at least once, then it is probably a very bad strategy. Margin Call is a last resort, last security measure - all the risks should be calculated by the strategy algorithm before it is ever hit. So if you see a Margin Call being triggred, then something is wrong with risk management of the strategy. Therefore - don't use it!
Hammers & Stars StrategyOverview
This script trades basic hammer and shooting star candlestick patterns.
It's an extremely simple strategy with minimal filters, and according to my personal manual backtesting and automated trading results, performs best on the Daily chart on certain forex pairs.
It is intended to be traded on the forex markets but theoretically should work on all markets (especially if you optimize the settings).
The script also comes with complete AutoView automation for Oanda.
Make sure you've connected AutoView to TradingView and Oanda, then simply set an alert using the "alert() function calls only" condition and it will automatically execute trades based on whatever settings you've selected (only recommended for experienced traders - use at your own risk!)
If you're not sure how to set up AutoView, search "The Art of Trading AutoView Guide" on YouTube to find my detailed video guide.
Check out my website and YouTube channel for more information, scripts, resources and free Pine Script & trading lessons (link in my profile).
Best of luck with your trading!
- Matt / The Art of Trading
Settings Menu
Tooltips are included explaining what the various settings do, but here's a quick summary:
Strategy Settings
>= ATR Filter: Minimum size of entry candle compared to ATR
<= ATR Filter: Maximum size of entry candle compared to ATR
Stop Loss ATR: Stop loss multiplier (x ATR)
R:R: Risk:Reward profile
Fib Level: Used to calculate upper/lower third of candle. (For example, setting it to 0.5 will mean hammers must close >= 50% mark of the total candle size)
Start Date Filter: Date & time to begin trading from
End Date Filter: Date & time to stop trading
AutoView Oanda Settings
Use Oanda Demo: If turned on then oandapractice broker prefix will be used for AutoView alerts (demo account). If turned off then live account will be used
Use Limit Order: If turned on then AutoView will use limit orders. If turned off then market orders will be used (recommended to use limit order to mitigate spread issues)
Days To Leave Limit Order: This is your GTD setting (good til day)
Account Balance: Your account balance (used for calculating position size)
Account Currency: Your account balance currency (used for calculating position size)
Risk Per Trade %: Your risk per trade as a % of your account balance
Reversal with Bollinger Bands + RSI + ADX + ATR (Upgraded)Hi,
Welcome to my 4th script.
Someone asked me some questions about the Bollinger Band strategy I previously published. When I went back to my published script I couldn't help myself but simply try and make it better. Which I did.
Since I've published that script, I've gained much more knowledge about how Pinescript functions. As well as gaining more and more knowledge about how the markets are structered etc.
In this reversal script we use 4 indicators to determine good entry signals, we determine whether the market is ranging or trending and we still only want to take trades in the direction of the "trend".
Bollinger Bands are used for our entry signal. When price hits either side of the band, we wait for a reverse candlestick before we enter a position.
RSI is used to determine if we're in a trending market or in a ranging market. You can adjust the values in the inputs. You can determine the minimum RSI value and the maximum RSI value.
ADX is used the same way as RSI, you can adjust the value in the inputs. You can determine the minimum ADX value.
Last but not least we use two EMA's, a 200 EMA and 100 EMA. Both are adjustable through the inputs. I used two EMA's because I noticed when using this strategy that we'd enter a new position often after having a bad trade. Using two EMA's might clean up some signals, in my case with EUR/USD on a 15m timeframe, it didn't clean up enough signals.
All the default values are pretty decent but might require some finetuning on a certain instrument. Don't overfit the strategy though, that'll only give you bad signals in the future.
Then we are off to our exit signals.
Initially I wanted to incorporate my previous Bollinger Band exit signals as well, but it was too much of a hassle to make the script work as intended so I left it out. If you want to use those exit signals, just find my other script.
When we're in a position and price crosses the opposite band, we wait for a reverse candlestick before we exit the position.
Additionally we want our losses to be as small as possible, so we use RSI to signal us when the market is, or starts to, trend against us. This is where you use the minimum and maximum exit values. So when RSI crosses over or under that value, it'll exit the position.
Furthermore, we use the ATR indicator to set our stop loss, which is pretty basic stuff. You can adjust the ATR multiplier in the inputs. Disabling "Use Trailing Stop?" is really inadvisable unless you know this script inside out as your only exit signals will be opposite Bollinger Band Cross and RSI overbought / oversold areas.
Point of possible Reversal (PPR): forex Strategypoint of possible Reversal, PPR :
in this strategy I have tried to find out the possible Reversal points in the forex pairs. It’s the most resisted levels from where the trend takes up a particular direction. These PPR can lead the price in any direction depending upon the time zone its happening in.
In this strategy once the code finds a PPR it then checks for suitable time zone then it checks for the RSI confirmation, it checks for the Parkinson Volatility, it checks for internal Bar Strength (refer below for more information)
The following setting details will help you in the understanding the strategy and indicator used:
This indicator contains the following setting:
1.Fixed trading sessions for Long and Short
i. Fixed trading session for long trades (long position can be taken in that period of time only)
ii. Fixed trading session for short trades (Short position can be taken in that period of time only)
The concept behind restricting the time to go long or short is because in forex the particular pair move in a particular direction depending upon the currency and time zones.
This strategy works on different forex pairs, you need to find the best settings. I will be providing the best settings which works for this strategy and different pairs.
2.Setting for back test selection date range you can check the beck test of a particular time range.
3.You can check Long and Short positions performance separately, by unchecking the “ Go_long ” option it will remove all long positions from back test. Vice versa for “ Go_short "option
4.Internal Bar Strength
IBS is simply an indicator where you buy on weakness and sell on strength, the cornerstone of any mean-reverting strategy.
It oscillates from zero to one and measures the relative position of the closing price relative to the High and Low.
IBS = (Close – Low) / (High – Low)
In the input setting the you can disable enable the IBS option from the strategy.
5. Parkinson volatility
Parkinson volatility is a volatility measure that uses the stock’s high and low price of the day (can be changed in the setting, instead of day it can be set to any bar length)
The main difference between regular volatility and Parkinson volatility is that the latter uses high and low prices for a day, rather than only the closing price.
In the setting you have three option
1. Enter Volatility Threshold
If the Parkinson volatility value is greater than the the threshold value then it lets the trade happen.
2.Set the high/low bar time frame for calculating Parkinson volatility. ( Set 60m by default)
Formula used as below:
high_=security(syminfo.ticker, input("60"), high)
low_=security(syminfo.ticker, input("60"), low)
hourlyRangeSquared = pow((log(high_) - log(low_)), 2)
dailyParkinsonVol = sqrt(sum(hourlyRangeSquared, 24) / (4 * log(2)))
6. "Enter no of contract size"
This setting helps you to set the contract size , by default it is set to 100000.
7.This setting is for the PPR, in this you can change the search of PPR in another time frame, you can add higher timeframe PPR in the chart, by default the PPR is set to search for current time frame PPR.
8.Futrther confirmation of trade is done through the RSI criteria . In this I have provided four kind of RSI confirmation you can test all by selecting any one of the four.
1. filter trade on the basis of BB of RSI (as shown in the image)
2. filter trade on the basis of RSI Levels (RSI>50 for long, vice versa for short)
3. filter trade by rsi>basis of BB of RSI(for long) & rsi<50(for short)
4. filter trade by rsi>50(long) & rsi< basis of BB of RSI(short)
SELECT ONLY ONE OF THE ABOVE IN SETTING.
9.For Exiting the trade I have used the trailing SL you can change it in setting.
You can exit the trade using two targets (two take profit) using different size for editing the trade.
If you want to take only on target then you have to make QANTITY of shares for 1st Exit as 100. Then you will exit all your position in the first target achieved.
A big thanks to kodify.net there articles are very helpful kodify.net
Thanks to stack overflow community for clearing the doubts.
Thanks to Mickey for providing assistance.
Trading view official documentation on V4 of pine script also helped me.
BitcoinNinjas NINJASIGNALS V4 (Strategy)BitcoinNinjas NINJASIGNALS V4 (Strategy)
(for Cryptocurrencies, Forex, GunBot, ProfitTrailer, Autoview, CryptoHopper, manual or automated trading, and more)
This is version 4 of our Ninja Signals trading script, with accompanying backtesting strategy.
BitcoinNinjas NINJASIGNALS V4 (Script)
•Allows users to easily set automated buy/long and sell/short alerts on TradingView for use with automatic and manual trading of cryptocurrencies, Forex securities, and more (alerts are compatible with automatic trading software such as GunBot, ProfitTrailer, Autoview, CryptoHopper, and more).
•Synthesizes many powerful indicators [e.g., Relative Strength Index (RSI), Stochastic RSI, Money Flow Index (MFI), Moving Average Convergence Divergence (MACD), etc.) into one powerful script to generate very precise buy and sell signals in virtually all market conditions.
•Features user-defined adjustable calibration settings, allowing traders to customize the script to fit any currency / security on any exchange available through TradingView.com, simply by adjusting settings.
•Buy/Long arrows, Sell/Short arrows, & EMA trendline can be customized or hidden, if desired.
•Complete with backtesting strategy version of script which allows users to test various trading strategies based on the alerts the script generates (see information and screenshots below).
•Backtesting strategy features a user-defined adjustable date range, so traders can estimate performance of the script over specific periods of time, such as the last week, month, or year.
•Script and backtesting strategy feature many user-adjustable settings including stop loss and take profit alerts, an ‘only sell for profit’ option (Gunbot-specific), many different buy and sell filters, and more. Simply adjust the script settings and the backtesting results will automatically refresh.
•Backtesting strategy allows for pyramid buying to test various average down / dollar cost average trading strategies. Simply adjust the number of pyramid buys and the quantity of each buy.
•Fully compatible with margin and futures trading for any currency / security on TradingView.com.
DISCLAIMER: By using our BitcoinNinjas ‘Ninja Signals’ planning script, you agree to the BitcoinNinjas 'Terms of Use'. No sharing, copying, reselling, modifying, or any other forms of use are authorized for our documents, script / strategy, and the information published with them. This informational planning script / strategy is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. BitcoinNinjas is not responsible for any losses you may incur. Please invest wisely.
Break of structure (BOS) forex StrategyPlease read all Details before using this indicator
This strategy is based on taking position after the break of a Previous High/Low swing happens (fixed time frame), the break of structure happens because of the swing happens then we go long or short respectively in this strategy.
I will be discussing the setting details through which you can make it work on different forex pairs.
Does it work on other pairs?
Yes, I have found similar back test results on other USD pairs.
Does it works on smaller time frame?
Yes it does work on smaller time frame , you have to understand the below concepts used and try different settings.
For the user the most important thing is to understand the settings of the indicator so that they can optimize the setting and get the best results:
This indicator contains the following IMPORTANT setting:
i. Fixed trading session for long trades (long position can be taken in that period of time only)
ii. Fixed trading session for short trades (Short position can be taken in that period of time only)
The concept behind restricting the time to go long or short is because in forex the particular pair move in a particular direction depending upon the currency and time zones.
This strategy works on different forex pairs, you need to find the best settings. I will be providing the best settings which works for this strategy and different pairs.
2. Choose Previous High/Low Timeframe
This is the most important option where you have to choose the timeframe for which you want H/L by default it is set to “D”. This timeframe H/L reference will be taken for taking trading decisions.
3.Setting for back test selection date range you can check the beck test of a particular time range.
4.You can check Long and Short positions performance separately, by unchecking the “Go_long” option it will remove all long positions from back test. Vice versa for “Go_short option”
5.Internal Bar Strength
IBS is simply an indicator where you buy on weakness and sell on strength, the cornerstone of any mean-reverting strategy.
It oscillates from zero to one and measures the relative position of the closing price relative to the High and Low.
IBS = (Close – Low) / (High – Low)
In the input setting the you can disable enable the IBS option from the strategy.
6. Parkinson volatility
Parkinson volatility is a volatility measure that uses the stock’s high and low price of the day (can be changed in the setting, instead of day it can be set to any bar length)
The main difference between regular volatility and Parkinson volatility is that the latter uses high and low prices for a day, rather than only the closing price.
In the setting you have three option
i. Enter Volatility Threshold
If the Parkinson volatility value is greater than the the threshold value then it lets the trade happen.
ii.Set the high/low bar time frame for calculating Parkinson volatility. ( Set 60m by default)
Formula used as below:
high_=security(syminfo.ticker, input("60"), high)
low_=security(syminfo.ticker, input("60"), low)
hourlyRangeSquared = pow((log(high_) - log(low_)), 2)
dailyParkinsonVol = sqrt(sum(hourlyRangeSquared, 24) / (4 * log(2)))
7. "Enter no of contract size"
This setting helps you to set the contract size , by default it is set to 100000.
8. “Zigzag Filter Length” this setting is for SWING H/L Lookback. With the help of this I have ploted Swing Support and Resistance.
9.Futrther confirmation of trade is done through the RSI criteria. In this I have provided four kind of RSI confirmation you can test all by selecting any one of the four.
i. filter trade on the basis of BB of RSI (as shown in the image)
ii. filter trade on the basis of RSI Levels (RSI>50 for long, vice versa for short)
iii. filter trade by rsi>basis of BB of RSI(for long) & rsi<50(for short)
iv. filter trade by rsi>50(long) & rsi< basis of BB of RSI(short)
SELECT ONLY ONE OF THE ABOVE IN SETTING.
10.For Exiting the trade I have used the trailing SL you can change it in setting.
You can exit the trade using two targets (two take profit) using different size for exiting the trade.
If you want to take only on target then you have to make QANTITY of shares for 1st Exit as 100. Then you will exit all your position in the first target.
A big thanks to kodify.net there articles are very helpful kodify.net
Thanks to Mickey for providing assistance.
Thanks to stack overflow community for clearing the doubts.
Trading view official documentation on V4 of pine script also helped me.
Volume RSI Crypto This is a special version RSI, in this case , I am using the volume, which is measuring the speed and change of volume to the price both up and down size.
Volume RSI attempts to gauge price trend changes via changes in bullish and bearish movements.
Its formula is :
VoRSI = 100 - 100 / (1 + VoRS)
where VoRS is Volume Relative Strength over specified period which is calculated as a ratio between averages of Up-Volumes and Down-Volumes:
VoRS = (Average Up-Volume) / (Average Down-Volume)
The logic for this strategy is simple
We entry long when we have a crossover with the Overbought level and we entry short when we have a crossunder with oversold level.
If you have any questions, please let me knw !
CRYPTOOO FOX (Trading System)CRYPTOOO FOX (Trading System)
---DISCRIPTION---
How Strategy Work :
--Strategy is working on higher time frame so i use two high time frame
the higher is ( 2 H or 3 H or 4 H or 8 H or 12 H or Daily ) and the highest is ( Daily ) Time frame .
-- When the higher time frame cross over the Daily time frame( the Highest ) this mean the TREND and
the PRICE also going UP this strategy is going to long position ( Buy position ) .
-- When the higher time frame cross under Daily time frame( the Highest ) this mean the TREND and
the PRICE also going DOWN strategy going to ( close position ) .
-- Notes :
--Strategy use some averages to calculate the higher time frame .
--Strategy use parabolic indicator to filter entries which name is ( Filter )
--Strategy use one more candle close to confirm entry ( Filter 2 )
--This the best time frame ( HIGHER , HIGHEST ) in this strategy in profit and draw down .
--Strategy is working only in Long position i am not recommend to use it in short positions .
--THIS IS NO REPAINT STRATEGY .
--DON'T use it in DAILY time frame
--I recommend so mush to use take profit and stop loss although the low draw down but some time
the market have a huge movements .
---- Strategy Settings which we publish now :
Fees = 0.1 the same as market fees .
Equity = 10 % and you can change it as you want .
Filter = 4 .
Filter 2 = true ( Just mark in check box beside Filter 2 ) .
Charts which working in these settings :
Eth/Usdt- 30 min/Binance ( Current image ) .
Btc/Usdt- 30 min/Binance .
Bch/Usdt- 30 min/Binance .
We do a lot of tests to get the best profit and also the lowest draw down
we will update the new settings for new charts
[astropark] Trend Skywalker V1 [strategy]Dear Followers,
today another awesome Swing and Scalping Trading Strategy indicator: Trend Skywalker !
It shows a trend cloud that reacts very fast to price action, so it's perfect for trending markets: it helps a lot to find out
when a trend is going to end and a new is going to start
when to enter again within a trending market
where to put your stoploss
In this example below you can see the three points above:
In fact in a trending market it will highlight that:
price consolidation within the could is a trend weakening signal , so you can easily spot when a trend is going to end and a new is going to start
bullish/bearish trend cloud retests are nice opportunity to re-enter within a trending market, especially if cloud is thick
where to put your stoploss ( below the cloud and/or recent low in a buy scenario , above the cloud and/or recent high in a sell scenario )
This strategy/indicator has the following options:
change analysis window (the lower, the more reactive; the higher, the less reactive)
enable/disable signals on chart
enable/disable "more confirmations" signals filter
enable/disable bars and background coloring based on trend
enable/disable an automatic Trailing Stop strategy option (Automatic Stops)
enable/disable a peak profit tracker (the max percentage profit labels)
enable/disable highlights of trend cloud retests
enable/disable highlights of trend cloud price breakouts
Here below some examples how the indicator works on many markets and timeframe.
ETH/USD 4h
EUR/USD 15m
LTC/BTC 1h
This strategy only trigger 1 buy (where to start a long trade) or 1 sell (for short trade).
Keep in mind that proper risk management and money management strategies are very important to manage your trades (DM me if you need any clarification on these points).
This script will let you backtest the strategy performance over the backtesting period you set in input (it may be a lower period, depending on tradingview candles limitation related to your account).
The one for setting alarms can be found by searching for the astropark's "Trend Skywalker" and then choosing the indicator with "alarms" suffix in the name.
Strategy results are calculated on the time window from February 2018 to now, so about 3 years, using 10000$ as initial capital and working at 1x leverage (so no leverage at all! If you like to use leverage, be sure to use a safe option, like 2x or 3x at most in order to have liquidation price very far).
This is not the "Holy Grail", so use proper money and risk management strategies.
This is a premium indicator , so send me a private message in order to get access to this script.
TradingView Alerts to MT4 MT5 - Forex, indices, commoditiesHowdy Algo-Traders! This example script has been created for educational purposes - to present how to use and automatically execute TradingView Alerts on real markets.
I'm posting this script today for a reason. TradingView has just released a new feature of the PineScript language - ALERT() function. Why is it important? It is finally possible to set alerts inside PineScript strategy-type script, without the need to convert the script into study-type. You may say triggering alerts straight from strategies was possible in PineScript before (since June 2020), but it had its limitations. Starting today you can attach alert to any custom event you might want to include in your PineScript code.
With the new feature, it is easier not only to execute strategies, but to maintain codebase - having to update 2 versions of the code with each single modification was... ahem... inconvenient. Moreover, the need to convert strategy into study also meant it was required to rip the code from all strategy...() calls, which carried a lot of useful information, like entry price, position size, and more, definitely influencing results calculated by strategy backtest. So the strategy without these features very likely produced different results than with them. While it was possible to convert these features into study with some advanced "coding gymnastics", it was also quite difficult to test whether those gymnastics didn't introduce serious, bankrupting bugs.
//////
How does this new feature work? It is really simple. On your custom events in the code like "GoLong" or "GoShort", create a string variable containing all the values you need inside your alert and this string variable will be your alert's message. Then, invoke brand new alert() function and that's it (see lines 67 onwards in the script). Set it up in CreateAlert popup and enjoy. Alerts will trigger on candle close as freq= parameter specifies. Detailed specification of the new alert() function can be found in TradingView's PineScript Reference (www.tradingview.com), but there's nothing more than message= and freq= parameters. Nothing else is needed, it is very simple. Yet powerful :)
//////
Alert syntax in this script is prepared to work with TradingConnector. Strategy here is not too complex, but also not the most basic one: it includes full exits, partial exits, stop-losses and it also utilizes dynamic variables calculated by the code (such as stop-loss price). This is only an example use case, because you could handle variety of other functionalities as well: conditional entries, pending entries, pyramiding, hedging, moving stop-loss to break-even, delivering alerts to multiple brokers and more.
//////
This script is a spin-off from my previous work, posted over a year ago here: Some comments on strategy parameters have been discussed there, but let me copy-paste most important points:
* Commission is taken into consideration.
* Slippage is intentionally left at 0. Due to shorter than 1 second delivery time of TradingConnector, slippage is practically non-existing.
* This strategy is NON-REPAINTING and uses NO TRAILING-STOP or any other feature known to be causing problems.
* The strategy was backtested on EURUSD 6h timeframe, will perform differently on other markets and timeframes.
Despite the fact this strategy seems to be still profitable, it is not guaranteed it will continue to perform well in the future. Remember the no.1 rule of backtesting - no matter how profitable and good looking a script is, it only tells about the past. There is zero guarantee the same strategy will get similar results in the future.
Full specs of TradingView alerts and how to set them up can be found here: www.tradingview.com
POW EdgeHello fellow Trading View member,
Eventually our rebranded update with some extra features for our exclusive 'Edge' Strategy Script.
In this description I will run through;
The strategy itself, what is it?
What does it do?
How does it work?
How can it help you?
How good is it?
What is it.....
The Edge Strategy itself is based upon 5 indicators lining up in total confluence to enter a position in line with a trending move. Adding them together adds more confluence and probability to each individual trade outcome over the longer term. The individual strategies used are based on Trend strategies all used in combination.
The uniqueness to this is how they are combined. Indicators can work to a point individually of course, but combining them together and only trading when all are in a line was our concept, whilst reviewing how each individual indicator can be optimised to work with the others.
Also the motivation was to be the right side of the market in a trending move and capitalising on as much as that move as possible.
The first part is to ensure the candle close is above or below our moving average, we can then check the state and validity of each of the other 4 indicators. Once this confluence is in alignment a trade is valid for entry - this has to be valid at the same time - but not all valid on the same candle - they will come into alignment in different stages. But once they are, our trade is valid.
I will not reveal the other individual 3 indicators but the other is also an ADX function to add a threshold into the strategy to identify a trend - usually above 20/25. This has upsides and downsides as any user can visualise and see in the testing.
We also add to the script to look for a Buy then Sell, Sell then Buy - we found this had more profitable results overall and next phase was to review the money management; where and how we placed our SL and when and why we exited the trade.
Example - for a BUY trade to be valid, all 5 indictors must meet their own criteria before a BUY is printed on the chart. Absolutely no technical analysis is needed to trade this strategy and the data we have is based on using the strategy in isolation - how you wish to use this either independently or supporting your own trading is of course, up to you.
The SL and TP's are based on ATR Multipliers thus ensuring we are factoring in market volatility at that time. We also have a FT (Follow Trend) option, which is a worthy addition for capitalising on big trending moves.
This strategy will work on all markets and timeframes.
We understand and accept that all pairs and markets are different thus we have optimised certain pairs and timeframes with different parameters to provide increased returns, these are hard coded (H1 Timeframe) and also provided for your review.
Profitability is easily viewable in the ‘Strategy Tester’ - this is a great tool. This is where you can see historic / live data for the strategy.
Data like;
The Net Profit
Number of trades
Win Percentage
Every trade taken
Average Win
Average Loss
Maximal DD , etc.
We have individually optimised each pair to ensure this is the case and hard coded these parameters into the strategy. All you need to do is flick between the pairs - the strategy will then identify the pair you are on and change the parameters to suit in the background.
Whilst a trade is open, the strategy will convert all candles to the relevant colour - Green for an uptrend and Red for a downtrend (all customisable).
We find this is helpful for traders psychology - not getting 'spooked' by other candle colours, affecting your decision making.
When a new signal is valid, 'POW BUY' or 'POW SELL' will be displayed on the first candle open for entry. As well as this, you will also have the trade label print which will display the following;
- EP – Entry price
- SL – Stop loss
- TP – Take Profit
- Lot size
The trade information printed will also tell you the pip values of your stop loss and take profit based on how far away they are from the trade entry price.
The lot size printed is customisable and unique to your account- within the strategy settings you can simply input your account balance, currency and risk approach which includes a fixed risk amount, fixed lot size or a fixed percentage.
This removes the need for 3rd party apps or websites to quickly calculate your specific risk on your trade. Thus saving you time and making sure you aren't 'guessing' with your lot size.
No one likes losing more than they thought.
The progress and initial challenges....
To start, our first version simply showed the buy and sell arrows when a trade was valid. However, this caused subjectivity with where we would place our stop loss and how we would manage the exit of the trade once we were in it. So, we identified a solid strategy for this was incorporating the Average True Range (ATR) for SL and TP options.
I was especially keen to add the SL and exit management so I could obtain solid back testing data to support my thoughts that 'this works'. Every trader requires confidence and belief in their strategy, without it you simply won't succeed or be disciplined in your execution.
The other challenge we all face is calculating the lot sizes of our trades right? So, it was important that we incorporated a lot size calculator - its all about making it easy when a trade is valid to enter without trying to calculate this accurately.
Lastly, when pairs are stuck in a range - this can be a testing period of 'chop' for a trend strategy, so we also incorporated the ADX function to enable us to set a threshold level to identify when the instrument is more likely to be trending.
What does it do?
Ultimately, tells you when to buy and sell - where to place your SL and when to exit. Whilst also ensuring your risk management is on point, by displaying your trading lot size. Also providing you with live back tested data at your finger tips thank you to the strategy tester.
How does it work?
This will be visible on your trading view charts once you get access. And will work across all your devices, the trading view website or the app on your phone for example.
You can also use Trading View alerts, so you won't miss a trade and can go about your day as normal without watching the screen. This will work on the Free version of TV, however, in order to benefit from more alerts and templates it makes sense to upgrade to a higher package.
How can it help you?
This will help give you a mechanical approach to your trading. This means, less decision making on your part, with the instant benefit of seeing the data you have at your fingertips thanks to the 'Strategy Tester' TV Function.
It will save you time, you don't need to be in front of your screen or completing any subjective analysis.
Integrated lot size calculator can ensure you are always accurate with your risk - either in percentage or a fixed amount of risk - whichever you prefer.
Understand Probability - this is the key one for me. Losing runs happen in any trading strategy. The great benefit here, is you can see them. How long were the losing runs? How can I prepare and plan my risk management around them are all fundamental keys to managing your emotions and being detached from your trades. No one wants to feel stressed or anxious when trading.
Customisable exit strategies - A specific TP for a 1:1 RR or 1:10 RR for example can be adjusted and you can see instantly how this affects the profitability.
The exit strategy options are shown below;
TP 1/2/3
FT - Follow Trend (no stop loss and follow's from Buys to Sells, Sell to Buy, etc.
SL + FT - SL present, but trade is held until a reverse signal is presented.
How good is it?
We have some really positive back testing data across a range of pairs and markets - equities and indices too.
Drop me a DM to see these and I'll be happy to share.
Below let me show you a screen shot of how this can work for you.
How do you access this?
Please visit our website for signup / purchase information in the first instance (the link is on our trading view signature) or send us a private message on here - its impossible to keep track of comments on our posts so to ensure we don't miss you, a private DM will be great please.
The Back test shown on this example is based on the Trading View mid price and also a realistic starting Capital of £10,000. This test result is also based on a 0.1% risk per trade, with a 5 tick spread and a commission of
Regards
Darren
Disclaimer alert.
Please remember past performance is exactly that - how our strategy performed over those dates tested, it is not obviously a guarantee of future performance. Most of our H1 data is valid from Jan 2017 to now - so 4+ years and data on 650+ trades per pair.
GBP/JPY Daily time FX Strategy ATR W% BaselineThis is a preety good strategy suited for long term trading.
It has been adapted and optimized in this case for GBP/JPY 1D time frame.
Its made of Kiojun baseline, together with ATR for stop loss and size calculation and Williams % R
For the purpose of this example we simulate that we have a leverage of 100x in order to be able to buy the ammount of lots required for our stop loss to be in same page with the risk % of our capital.
For entry we have for long, ascending R in the last 2 candles and crossover of close with KIOJUN baseline. For short the same but in reverse.
We exit if we reach the TP -100 points in this example, or SL , which is based on ATR of the last x days.
If you have any questions feel free to write me in private !
Marubozu Forex Price actionHi, today I bring you a price action strategy/indicator for Forex, made out for Marubozu candle type.
For the entries of it check if we have a long or a short marubozu.
For exit we have for long when the actual candle is green and the last previous two were red.
For exit we have for short, when the actual candle is red and the last previous two were green.
If you have any questions private message me !
London Breakout/Session GBP/USD Forex DaytradeThis is a forex strategy suited for day traders, specialized in the london breakout session
The key elements for this strategy are the specific london time session, together with an exit time(before asian trade/at the end of new york session).
At the same time, as logic elements we only use price action inside like :
For long we have 3 ascending candles, and for short we have 3 descending candles.
For exit we have both TP/SL based on price percentage movement, or we exit if we reach the end of the day.
If you have any questions message me in private !